{% extends "./inc/base.html" %}
{% block content %}
                <section class="vbox">
                    <header class="header bg-light dk">
                        <p>{{controller.meta_title}}</p>
                    </header>
                    <section class="scrollable wrapper">

                        <section class="panel panel-default">
                            <header class="panel-heading">
                                付款单列表
                            </header>
                            <div class="row wrapper">

                                <div class="col-sm-9 m-b-xs">
                                    <div class="btn-group">

                                        <a class="btn btn-sm btn-info {%if status == null %}active{%endif%}" href="/admin/fukuandan/list">
                                           全部付款单
                                        </a>
                                        <a class="btn btn-sm btn-info {%if status == 0 %}active{%endif%}" href="/admin/fukuandan/list/?status=0">
                                           未审核
                                        </a>
                                        <a class="btn btn-sm btn-info {%if status != 0 %}active{%endif%}" href="/admin/fukuandan/list/?status={{["!=",0]|jsonToStr}}">
                                           已审核
                                        </a>
                                    </div>
                                </div>
                            </div>
                            <div class="table-responsive">
                                <table class="table table-hover b-t b-light">
                                    <thead>
                                    <tr>
                                        <th style="width:20px;"><label class="checkbox m-n i-checks"><input type="checkbox"><i></i></label></th>
                                        <th>付款单编号</th>
                                        <th>发起人</th>
                                        <th>订单编号</th>
                                        <th>合同编号</th>
                                        <th>付款比例</th>
                                        <th>付款金额</th>
                                        <th>付款时间</th>
                                        <th>状态</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {% for item in list %}
                                    <tr >
                                        <td><label class="checkbox m-n i-checks"><input class="ids" type="checkbox" name="ids" value="{{item.id}}"><i></i></label></td>
                                        <td>{{item.fukuanno}}</td>
                                        <td><a href="/admin/user/showuser/?id={{item.user_id}}" class="text-info" data-toggle="ajaxModal">{{item.user_id|get_realname}}</a></td>
                                        <td>{{item.order_no}}</td>
                                        <td>{{item.htbh}}</td>
                                        <td>{{item.persent}}</td>
                                        <td>￥{{item.fukuanjine}}</td>
                                        <td>{{item.chuangjianshijian|moment("YYYY-MM-DD HH:mm:ss")}}</td>
                                        <td class="text-danger">
                                            {%if item.status == 0%}<span class="text-muted">待审核</span>
                                            {%elif item.status == 1%}<span class="text-success">已审核</span>
                                            {%elif item.status == 2%}<span class="text-success">已退回</span>
                                            {%elif item.status == 3%}<span class="text-success">已完成</span>
                                            {%else%}<del>已作废</del>{%endif%}</td>
                                        <td><div class="btn-group">
		                  <button data-toggle="dropdown" class="btn btn-default btn-xs dropdown-toggle"><i class="fa fa-cog"></i> 处理 <span class="caret"></span></button>
		                  <ul class="dropdown-menu dropdown-menu-right">
                              <!--<li><a href="/admin/fukuandan/see/?id={{item.id}}" data-toggle="ajaxModal"><i class="fa fa-eye"></i> 查看</a></li>-->
                              {%if item.status == 0%}<li><a href="/admin/fukuandan/audit/?id={{item.id}}" data-toggle="ajaxModal"><i class="fa fa-check-square-o"></i> 分配内勤</a></li>{%endif%}
                              <li><a href="/admin/fukuandan/void/?id={{item.id}}" data-toggle="ajaxModal"><i class="fa fa-trash-o"></i> 退回</a></li>
		                  </ul>
		                </div></td>
                                    </tr>
                                    {% else %}
                                    <tr><td colspan="11"><div class="alert alert-warning alert-block">
                                        <button data-dismiss="alert" class="close" type="button">×</button>
                                        <p>暂无数据</p>
                                    </div></td></tr>

                                    {% endfor %}


                                    </tbody>
                                </table>
                            </div>
                            <footer class="panel-footer">
                                <div class="row">


                                    <div class="col-sm-12 text-right text-center-xs">
                                        {{pagerData | safe}}
                                    </div>
                                </div>
                            </footer>
                        </section>
                    </section>
                </section>

{% endblock %}
{% block script%}
<script src="/static/admin/js/parsley/parsley.min.js"></script>
<script src="/static/admin/js/parsley/parsley.extend.js"></script>
<script>
    $(function () {
      //搜索功能
      $("#search").click(function(){
        var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
          url += '&' + query;
        }else{
          url += '?' + query;
        }
        window.location.href = url;
      });

      //回车自动提交
      $('.search-form').find('input').keyup(function(event){
        if(event.keyCode===13){
          $("#search").click();
        }
      });

    })
</script>
{% endblock%}
